/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  @endpointMap = {
    cn-beijing = 'adcp.cn-beijing.aliyuncs.com',
    cn-zhangjiakou = 'adcp.cn-zhangjiakou.aliyuncs.com',
    cn-hangzhou = 'adcp.cn-hangzhou.aliyuncs.com',
    cn-shanghai = 'adcp.cn-shanghai.aliyuncs.com',
    cn-shenzhen = 'adcp.cn-shenzhen.aliyuncs.com',
    cn-heyuan = 'adcp.cn-heyuan.aliyuncs.com',
    cn-hongkong = 'adcp.cn-hongkong.aliyuncs.com',
    ap-northeast-1 = 'adcp.ap-northeast-1.aliyuncs.com',
    ap-southeast-1 = 'adcp.ap-southeast-1.aliyuncs.com',
    ap-southeast-5 = 'adcp.ap-southeast-5.aliyuncs.com',
    ap-south-1 = 'adcp.ap-south-1.aliyuncs.com',
    ap-southeast-2 = 'adcp.ap-southeast-2.aliyuncs.com',
    ap-southeast-3 = 'adcp.ap-southeast-3.aliyuncs.com',
    cn-chengdu = 'adcp-vpc.cn-chengdu.aliyuncs.com',
    cn-huhehaote = 'adcp.cn-huhehaote.aliyuncs.com',
    cn-qingdao = 'adcp.cn-qingdao.aliyuncs.com',
    cn-shanghai-finance-1 = 'adcp-vpc.cn-shanghai-finance-1.aliyuncs.com',
    cn-wulanchabu = 'adcp.cn-wulanchabu.aliyuncs.com',
    eu-central-1 = 'adcp.eu-central-1.aliyuncs.com',
    eu-west-1 = 'adcp-vpc.eu-west-1.aliyuncs.com',
    me-east-1 = 'adcp.me-east-1.aliyuncs.com',
    us-east-1 = 'adcp.us-east-1.aliyuncs.com',
    us-west-1 = 'adcp.us-west-1.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('adcp', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model Tag {
  key?: string(name='Key', example='env'),
  value?: string(name='Value', example='prod'),
}

model AttachClusterToHubRequest {
  attachToMesh?: boolean(name='AttachToMesh', description='The operation that you want to perform. Set the value to **AttachClusterToHub**.', example='true'),
  clusterId?: string(name='ClusterId', description='The ID of the task.

This parameter is required.', example='cd08d62e6506a4fa5a8c44c19d0fc****'),
  clusterIds?: string(name='ClusterIds', description='The ID of the request.

This parameter is required.', example='["cdea10134be464ba4acb36cc831a6****"]'),
}

model AttachClusterToHubResponseBody = {
  clusterId?: string(name='ClusterId', description='You can call the AttachClusterToHub operation to associate an Container Service for Kubernetes (ACK) cluster with a master instance of ACK One.', example='c8e28143817db4b039b8548d7c899****'),
  managedClusterIds?: [ string ](name='ManagedClusterIds', description='Zhishi'),
  requestId?: string(name='RequestId', description='Example 1', example='EA06613B-37A3-549E-BAE0-E4AD8A6E93D7'),
  taskId?: string(name='TaskId', example='T-623a96b7bbeaac074b00****'),
}

model AttachClusterToHubResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AttachClusterToHubResponseBody(name='body'),
}

/**
 * @summary You can search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.
 *
 * @param request AttachClusterToHubRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AttachClusterToHubResponse
 */
async function attachClusterToHubWithOptions(request: AttachClusterToHubRequest, runtime: Util.RuntimeOptions): AttachClusterToHubResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.attachToMesh)) {
    query['AttachToMesh'] = request.attachToMesh;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterIds)) {
    body['ClusterIds'] = request.clusterIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AttachClusterToHub',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary You can search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.
 *
 * @param request AttachClusterToHubRequest
 * @return AttachClusterToHubResponse
 */
async function attachClusterToHub(request: AttachClusterToHubRequest): AttachClusterToHubResponse {
  var runtime = new Util.RuntimeOptions{};
  return attachClusterToHubWithOptions(request, runtime);
}

model ChangeResourceGroupRequest {
  newResourceGroupId?: string(name='NewResourceGroupId', description='The ID of the new resource group. You can view the available resource groups in the Resource Management console.

This parameter is required.', example='rg-aekzlvgbhaca***'),
  resourceId?: string(name='ResourceId', description='The ID of the resource. The value of this parameter varies with the resource type. For example, if you set ResourceType to cluster, this parameter specifies a cluster ID.

This parameter is required.', example='c9603ee23a84a41d6a1424619cb80****'),
  resourceType?: string(name='ResourceType', description='The resource type. Set the value to cluster.', example='cluster'),
}

model ChangeResourceGroupResponseBody = {
  requestId?: string(name='RequestId', description='Id of the request', example='5BE4C329-DCC2-5B61-8F66-112B7D7FC712'),
}

model ChangeResourceGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ChangeResourceGroupResponseBody(name='body'),
}

/**
 * @summary 更新资源组
 *
 * @param request ChangeResourceGroupRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroupWithOptions(request: ChangeResourceGroupRequest, runtime: Util.RuntimeOptions): ChangeResourceGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.newResourceGroupId)) {
    query['NewResourceGroupId'] = request.newResourceGroupId;
  }
  if (!Util.isUnset(request.resourceId)) {
    query['ResourceId'] = request.resourceId;
  }
  if (!Util.isUnset(request.resourceType)) {
    query['ResourceType'] = request.resourceType;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ChangeResourceGroup',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 更新资源组
 *
 * @param request ChangeResourceGroupRequest
 * @return ChangeResourceGroupResponse
 */
async function changeResourceGroup(request: ChangeResourceGroupRequest): ChangeResourceGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return changeResourceGroupWithOptions(request, runtime);
}

model CreateHubClusterRequest {
  apiServerPublicEip?: boolean(name='ApiServerPublicEip', description='Specifies whether to expose the API server to the Internet. Valid values:

*   true: exposes the API server to the Internet.
*   false: exposes the API server to the internal network.', example='true'),
  argoServerEnabled?: boolean(name='ArgoServerEnabled', description='Specifies whether to enable the workflow instance UI. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  auditLogEnabled?: boolean(name='AuditLogEnabled', description='Specifies whether to enable the audit log feature. Valid values:

*   true: enables the audit log feature.
*   false: disables the audit log feature.', example='false'),
  isEnterpriseSecurityGroup?: boolean(name='IsEnterpriseSecurityGroup', description='Specifies whether to use an advanced security group.', example='false'),
  name?: string(name='Name', description='The name of the master instance.', example='ack-demo'),
  priceLimit?: string(name='PriceLimit', description='The limit on the prices of containers in the workflow. This parameter takes effect only if the WorkflowScheduleMode parameter is set to cost-optimized.', example='0.08'),
  profile?: string(name='Profile', description='The type of scenario for which the master instance is suitable. Valid values:

*   `Default`: The master instance is suitable for standard scenarios.
*   `XFlow`: The master instance is suitable for workflow scenarios.

Default value: `Default`.', example='Default'),
  regionId?: string(name='RegionId', description='The ID of the region. You can call the DescribeRegions operation to query available regions.

This parameter is required.', example='cn-beijing'),
  resourceGroupID?: string(name='ResourceGroupID', description='The Resource Group ID.', example='rg-1exm6tg2h48***'),
  tag?: [
    Tag
  ](name='Tag', description='The tags.

You can specify at most 20 tags in each call.'),
  vSwitches?: string(name='VSwitches', description='The ID of the vSwitch.

This parameter is required.', example='["vsw-2zeaijsas4zkzz81xm***"]'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) to which the master instance belongs. You can call the DescribeVpcs operation to query available VPCs.

This parameter is required.', example='vpc-f8zin0jscsr84s96tg***'),
  workflowScheduleMode?: string(name='WorkflowScheduleMode', description='The scheduling mode of the workflow. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   cost-optimized: cost-prioritized scheduling mode.
*   stock-optimized: inventory-prioritized scheduling mode.', example='cost-optimized'),
}

model CreateHubClusterShrinkRequest {
  apiServerPublicEip?: boolean(name='ApiServerPublicEip', description='Specifies whether to expose the API server to the Internet. Valid values:

*   true: exposes the API server to the Internet.
*   false: exposes the API server to the internal network.', example='true'),
  argoServerEnabled?: boolean(name='ArgoServerEnabled', description='Specifies whether to enable the workflow instance UI. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  auditLogEnabled?: boolean(name='AuditLogEnabled', description='Specifies whether to enable the audit log feature. Valid values:

*   true: enables the audit log feature.
*   false: disables the audit log feature.', example='false'),
  isEnterpriseSecurityGroup?: boolean(name='IsEnterpriseSecurityGroup', description='Specifies whether to use an advanced security group.', example='false'),
  name?: string(name='Name', description='The name of the master instance.', example='ack-demo'),
  priceLimit?: string(name='PriceLimit', description='The limit on the prices of containers in the workflow. This parameter takes effect only if the WorkflowScheduleMode parameter is set to cost-optimized.', example='0.08'),
  profile?: string(name='Profile', description='The type of scenario for which the master instance is suitable. Valid values:

*   `Default`: The master instance is suitable for standard scenarios.
*   `XFlow`: The master instance is suitable for workflow scenarios.

Default value: `Default`.', example='Default'),
  regionId?: string(name='RegionId', description='The ID of the region. You can call the DescribeRegions operation to query available regions.

This parameter is required.', example='cn-beijing'),
  resourceGroupID?: string(name='ResourceGroupID', description='The Resource Group ID.', example='rg-1exm6tg2h48***'),
  tagShrink?: string(name='Tag', description='The tags.

You can specify at most 20 tags in each call.'),
  vSwitches?: string(name='VSwitches', description='The ID of the vSwitch.

This parameter is required.', example='["vsw-2zeaijsas4zkzz81xm***"]'),
  vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) to which the master instance belongs. You can call the DescribeVpcs operation to query available VPCs.

This parameter is required.', example='vpc-f8zin0jscsr84s96tg***'),
  workflowScheduleMode?: string(name='WorkflowScheduleMode', description='The scheduling mode of the workflow. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   cost-optimized: cost-prioritized scheduling mode.
*   stock-optimized: inventory-prioritized scheduling mode.', example='cost-optimized'),
}

model CreateHubClusterResponseBody = {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.', example='c09946603cd764dac96135f51d1ba****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='62F5AA2B-A2C9-5135-BCE2-C2167099****'),
  taskId?: string(name='TaskId', description='The ID of the task.', example='T-62523eda841eca071400****'),
}

model CreateHubClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateHubClusterResponseBody(name='body'),
}

/**
 * @summary Creates a master instance in Alibaba Cloud Distributed Cloud Container Platform (ACK One).
 *
 * @param tmpReq CreateHubClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateHubClusterResponse
 */
async function createHubClusterWithOptions(tmpReq: CreateHubClusterRequest, runtime: Util.RuntimeOptions): CreateHubClusterResponse {
  Util.validateModel(tmpReq);
  var request = new CreateHubClusterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.apiServerPublicEip)) {
    body['ApiServerPublicEip'] = request.apiServerPublicEip;
  }
  if (!Util.isUnset(request.argoServerEnabled)) {
    body['ArgoServerEnabled'] = request.argoServerEnabled;
  }
  if (!Util.isUnset(request.auditLogEnabled)) {
    body['AuditLogEnabled'] = request.auditLogEnabled;
  }
  if (!Util.isUnset(request.isEnterpriseSecurityGroup)) {
    body['IsEnterpriseSecurityGroup'] = request.isEnterpriseSecurityGroup;
  }
  if (!Util.isUnset(request.name)) {
    body['Name'] = request.name;
  }
  if (!Util.isUnset(request.priceLimit)) {
    body['PriceLimit'] = request.priceLimit;
  }
  if (!Util.isUnset(request.profile)) {
    body['Profile'] = request.profile;
  }
  if (!Util.isUnset(request.regionId)) {
    body['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.resourceGroupID)) {
    body['ResourceGroupID'] = request.resourceGroupID;
  }
  if (!Util.isUnset(request.vSwitches)) {
    body['VSwitches'] = request.vSwitches;
  }
  if (!Util.isUnset(request.vpcId)) {
    body['VpcId'] = request.vpcId;
  }
  if (!Util.isUnset(request.workflowScheduleMode)) {
    body['WorkflowScheduleMode'] = request.workflowScheduleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateHubCluster',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Creates a master instance in Alibaba Cloud Distributed Cloud Container Platform (ACK One).
 *
 * @param request CreateHubClusterRequest
 * @return CreateHubClusterResponse
 */
async function createHubCluster(request: CreateHubClusterRequest): CreateHubClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createHubClusterWithOptions(request, runtime);
}

model DeleteHubClusterRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='cd90dd24a86fd42f895a1b77df620****'),
  force?: boolean(name='Force', description='Specifies whether to forcefully delete the master instance in ACK One. Valid values:

*   true: forcefully deletes the master instance in ACK One.
*   false: does not forcibly delete the master instance in ACK One.

Default value: false.', example='false'),
  retainResources?: [ string ](name='RetainResources', description='The list of resources to retain.'),
}

model DeleteHubClusterShrinkRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='cd90dd24a86fd42f895a1b77df620****'),
  force?: boolean(name='Force', description='Specifies whether to forcefully delete the master instance in ACK One. Valid values:

*   true: forcefully deletes the master instance in ACK One.
*   false: does not forcibly delete the master instance in ACK One.

Default value: false.', example='false'),
  retainResourcesShrink?: string(name='RetainResources', description='The list of resources to retain.'),
}

model DeleteHubClusterResponseBody = {
  clusterId?: string(name='ClusterId', description='The ID of the cluster.', example='cb09fda0dc2f94a8397c76638c7ec****'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='7A827E32-6D24-5757-B3FD-D9396495FBDC'),
  taskId?: string(name='TaskId', description='The ID of the job.', example='T-623a96b7bbeaac074b00****'),
}

model DeleteHubClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteHubClusterResponseBody(name='body'),
}

/**
 * @summary Deletes a master cluster in Alibaba Cloud Distributed Cloud Container Platform (ACK One).
 *
 * @param tmpReq DeleteHubClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteHubClusterResponse
 */
async function deleteHubClusterWithOptions(tmpReq: DeleteHubClusterRequest, runtime: Util.RuntimeOptions): DeleteHubClusterResponse {
  Util.validateModel(tmpReq);
  var request = new DeleteHubClusterShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.retainResources)) {
    request.retainResourcesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.retainResources, 'RetainResources', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.force)) {
    query['Force'] = request.force;
  }
  if (!Util.isUnset(request.retainResourcesShrink)) {
    query['RetainResources'] = request.retainResourcesShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteHubCluster',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a master cluster in Alibaba Cloud Distributed Cloud Container Platform (ACK One).
 *
 * @param request DeleteHubClusterRequest
 * @return DeleteHubClusterResponse
 */
async function deleteHubCluster(request: DeleteHubClusterRequest): DeleteHubClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteHubClusterWithOptions(request, runtime);
}

model DeletePolicyInstanceRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c09946603cd764dac96135f51d1ba****'),
  clusterIds?: [ string ](name='ClusterIds', description='A array of JSON strings. The JSON strings in the array indicate the IDs of the associated clusters for which the policy is deleted.'),
  policyName?: string(name='PolicyName', description='The name of the policy.

This parameter is required.', example='ACKNoEnvVarSecrets'),
}

model DeletePolicyInstanceShrinkRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c09946603cd764dac96135f51d1ba****'),
  clusterIdsShrink?: string(name='ClusterIds', description='A array of JSON strings. The JSON strings in the array indicate the IDs of the associated clusters for which the policy is deleted.'),
  policyName?: string(name='PolicyName', description='The name of the policy.

This parameter is required.', example='ACKNoEnvVarSecrets'),
}

model DeletePolicyInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='EA06613B-37A3-549E-BAE0-E4AD8A6E93D7'),
}

model DeletePolicyInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePolicyInstanceResponseBody(name='body'),
}

/**
 * @summary Deletes a policy for associated clusters.
 *
 * @param tmpReq DeletePolicyInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePolicyInstanceResponse
 */
async function deletePolicyInstanceWithOptions(tmpReq: DeletePolicyInstanceRequest, runtime: Util.RuntimeOptions): DeletePolicyInstanceResponse {
  Util.validateModel(tmpReq);
  var request = new DeletePolicyInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.clusterIds)) {
    request.clusterIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.clusterIds, 'ClusterIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.clusterIdsShrink)) {
    query['ClusterIds'] = request.clusterIdsShrink;
  }
  if (!Util.isUnset(request.policyName)) {
    query['PolicyName'] = request.policyName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePolicyInstance',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes a policy for associated clusters.
 *
 * @param request DeletePolicyInstanceRequest
 * @return DeletePolicyInstanceResponse
 */
async function deletePolicyInstance(request: DeletePolicyInstanceRequest): DeletePolicyInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePolicyInstanceWithOptions(request, runtime);
}

model DeleteUserPermissionRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c09946603cd764dac96135f51d1ba****'),
  userId?: string(name='UserId', description='The ID of the RAM user.

This parameter is required.', example='2176****'),
}

model DeleteUserPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2D676EFC-8C04-5CCE-A08E-BB97D24B47E8'),
}

model DeleteUserPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteUserPermissionResponseBody(name='body'),
}

/**
 * @summary Deletes the role-based access control (RBAC) permissions of a RAM user.
 *
 * @param request DeleteUserPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteUserPermissionResponse
 */
async function deleteUserPermissionWithOptions(request: DeleteUserPermissionRequest, runtime: Util.RuntimeOptions): DeleteUserPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUserPermission',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deletes the role-based access control (RBAC) permissions of a RAM user.
 *
 * @param request DeleteUserPermissionRequest
 * @return DeleteUserPermissionResponse
 */
async function deleteUserPermission(request: DeleteUserPermissionRequest): DeleteUserPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUserPermissionWithOptions(request, runtime);
}

model DeployPolicyInstanceRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c102fe5f1ee5d4c87a68121a77d8b****'),
  clusterIds?: [ string ](name='ClusterIds', description='An array of JSON strings. The JSON strings in the array indicate the IDs of the associated clusters in which the policy instance is deployed.

This parameter is required.'),
  namespaces?: [ string ](name='Namespaces', description='A list of namespaces.'),
  policyAction?: string(name='PolicyAction', description='The action of the policy. Valid values:

*   deny: blocks deployments that match the policy.
*   warn: generates alerts for deployments that match the policy.

This parameter is required.', example='warn'),
  policyName?: string(name='PolicyName', description='The name of the policy.

This parameter is required.', example='ACKNoEnvVarSecrets'),
}

model DeployPolicyInstanceShrinkRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c102fe5f1ee5d4c87a68121a77d8b****'),
  clusterIdsShrink?: string(name='ClusterIds', description='An array of JSON strings. The JSON strings in the array indicate the IDs of the associated clusters in which the policy instance is deployed.

This parameter is required.'),
  namespacesShrink?: string(name='Namespaces', description='A list of namespaces.'),
  policyAction?: string(name='PolicyAction', description='The action of the policy. Valid values:

*   deny: blocks deployments that match the policy.
*   warn: generates alerts for deployments that match the policy.

This parameter is required.', example='warn'),
  policyName?: string(name='PolicyName', description='The name of the policy.

This parameter is required.', example='ACKNoEnvVarSecrets'),
}

model DeployPolicyInstanceResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='2D676EFC-8C04-5CCE-A08E-BB97D24B47E8'),
}

model DeployPolicyInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeployPolicyInstanceResponseBody(name='body'),
}

/**
 * @summary Deploys a policy instance in the clusters that are associated with a master instance.
 *
 * @param tmpReq DeployPolicyInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeployPolicyInstanceResponse
 */
async function deployPolicyInstanceWithOptions(tmpReq: DeployPolicyInstanceRequest, runtime: Util.RuntimeOptions): DeployPolicyInstanceResponse {
  Util.validateModel(tmpReq);
  var request = new DeployPolicyInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.clusterIds)) {
    request.clusterIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.clusterIds, 'ClusterIds', 'json');
  }
  if (!Util.isUnset(tmpReq.namespaces)) {
    request.namespacesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.namespaces, 'Namespaces', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.clusterIdsShrink)) {
    query['ClusterIds'] = request.clusterIdsShrink;
  }
  if (!Util.isUnset(request.namespacesShrink)) {
    query['Namespaces'] = request.namespacesShrink;
  }
  if (!Util.isUnset(request.policyAction)) {
    query['PolicyAction'] = request.policyAction;
  }
  if (!Util.isUnset(request.policyName)) {
    query['PolicyName'] = request.policyName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeployPolicyInstance',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Deploys a policy instance in the clusters that are associated with a master instance.
 *
 * @param request DeployPolicyInstanceRequest
 * @return DeployPolicyInstanceResponse
 */
async function deployPolicyInstance(request: DeployPolicyInstanceRequest): DeployPolicyInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return deployPolicyInstanceWithOptions(request, runtime);
}

model DescribeHubClusterDetailsRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c676decda7b8148d69a9aba751877****'),
}

model DescribeHubClusterDetailsResponseBody = {
  cluster?: {
    apiServer?: {
      apiServerEipId?: string(name='ApiServerEipId', description='The ID of the elastic IP address (EIP).', example='eip-abc****'),
      enabledPublic?: boolean(name='EnabledPublic', description='Indicates whether the API server is accessible over the Internet. Valid values:

*   true: The API server is accessible over the Internet.
*   false: The API server is inaccessible over the Internet.', example='true'),
      loadBalancerId?: string(name='LoadBalancerId', description='The ID of the Server Load Balancer (SLB) instance.', example='lb-hp3ioqbfeq37h13rwe***'),
    }(name='ApiServer', description='The details of the API server of the master instance.'),
    clusterInfo?: {
      clusterId?: string(name='ClusterId', description='The ID of the master instance.', example='cb09fda0dc2f94a8397c76638c7ecf***'),
      clusterSpec?: string(name='ClusterSpec', description='The specification of the master instance. Valid value:

*   ack.pro.small: ACK Pro cluster', example='ack.pro.small'),
      creationTime?: string(name='CreationTime', description='The time when the master instance was created.', example='2022-03-23T06:22:28Z'),
      errorMessage?: string(name='ErrorMessage', description='The error message returned when the master instance failed to be created.', example='The specified product does not exist.'),
      metaData?: {
        ACKOne?: {
          gitOps?: {
            accessControlList?: [ string ](name='AccessControlList', description='The Internet access control list (ACL). This parameter takes effect only if PublicAccessEnabled is set to true.'),
            enabled?: boolean(name='Enabled', description='Indicates whether GitOps is enabled. Valid values:

*   true: GitOps is enabled.
*   false: GitOps is disabled.', example='true'),
            HAEnabled?: boolean(name='HAEnabled', description='Indicates whether GitOps High Availability is enabled. Valid values:

*   true:  GitOps High Availability is enabled.
*   false:  GitOps High Availability is disabled.', example='true'),
            publicAccessEnabled?: boolean(name='PublicAccessEnabled', description='Specifies whether to enable public domain name resolution in the Argo CD or Argo Workflow console. Valid values:

*   true
*   false', example='true'),
          }(name='GitOps', description='The GitOps metadata.'),
          workFlow?: {
            argoWorkflow?: {
              accessControlList?: [ string ](name='AccessControlList', description='The Internet access control list (ACL). This parameter takes effect only if PublicAccessEnabled is set to true.'),
              enabled?: boolean(name='Enabled', description='Specifies whether to enable the argo workflow. Valid values:

*   **false** (default)
*   **true**', example='true'),
              publicAccessEnabled?: boolean(name='PublicAccessEnabled', description='Specifies whether to enable public domain name resolution in the Argo CD or Argo Workflow console. Valid values:

*   true
*   false', example='true'),
              serverEnabled?: string(name='ServerEnabled', description='Specifies whether to enable the argo workflow. UI Valid values:

*   **false** (default)
*   **true**', example='true'),
            }(name='ArgoWorkflow', description='The Argo workflow metadata.'),
          }(name='WorkFlow', description='The workflow metadata.'),
        }(name='ACKOne', description='The cluster metadata.'),
      }(name='MetaData', description='The cluster metadata.'),
      name?: string(name='Name', description='The name of the master instance.', example='ackone-heyuan'),
      profile?: string(name='Profile', description='The configurations of the master instance.', example='Default'),
      regionId?: string(name='RegionId', description='The ID of the region in which the master instance resides.', example='cn-beijing'),
      resourceGroupID?: string(name='ResourceGroupID', description='The ID of Resource Group.', example='rg-1w4vdvo6p51***'),
      state?: string(name='State', description='The status of the master instance. Valid values:

*   initial: The master instance is being initialized.
*   failed: The master instance failed to be created.
*   running: The master instance is running
*   inactive: The master instance is pending.
*   deleting: The master instance is being deleted.
*   delete_failed: The master instance failed to be deleted.
*   deleted: The master instance is deleted.', example='running'),
      tags?: [ 
        {
          key?: string(name='Key'),
          value?: string(name='Value'),
        }
      ](name='Tags'),
      updateTime?: string(name='UpdateTime', description='The time when the master instance was updated.', example='2022-03-21T02:51:35.542Z'),
      version?: string(name='Version', description='The version of the master instance.', example='1.22.3-aliyun.1'),
    }(name='ClusterInfo', description='The details of the master instance.'),
    conditions?: [ 
      {
        message?: string(name='Message', description='The error message returned.', example='Successful'),
        reason?: string(name='Reason', description='The reason for the deletion condition.', example='Successful'),
        status?: string(name='Status', description='The status of the master instance that the deletion condition indicates. Valid values:

*   True: The master instance cannot be deleted.
*   False: The master instance can be deleted.
*   Unknow: Whether the master instance can be deleted is unknown.', example='True'),
        type?: string(name='Type', description='The type of deletion condition.', example='DeletionProtection'),
      }
    ](name='Conditions', description='The deletion conditions of the master instance.'),
    endpoints?: {
      intranetApiServerEndpoint?: string(name='IntranetApiServerEndpoint', description='The endpoint that is used to access the API server over the internal network.', example='https://172.16.6.**:6443'),
      publicApiServerEndpoint?: string(name='PublicApiServerEndpoint', description='The endpoint that is used to access the API server over the Internet.', example='https://123.57.21.***:6443'),
    }(name='Endpoints', description='The endpoint of the master instance.'),
    logConfig?: {
      enableLog?: boolean(name='EnableLog', description='Indicates whether the audit logging feature is enabled. Valid values:

*   true: Audit logging is enabled.
*   false: Audit logging is disabled.', example='false'),
      logProject?: string(name='LogProject', description='The name of the project of Log Service.', example='k8s-log-abc'),
      logStoreTTL?: string(name='LogStoreTTL', description='The number of days that logs are retained by Log Service.', example='7'),
    }(name='LogConfig', description='The logging configuration.'),
    meshConfig?: {
      enableMesh?: boolean(name='EnableMesh', description='Indicates whether ASM is enabled. Valid values:

*   true: ASM is enabled.
*   false: ASM is disabled.', example='false'),
      meshId?: string(name='MeshId', description='service mesh (ASM) instance ID', example='cb09fda0dc2f94a8397c76638c7ecf***'),
    }(name='MeshConfig', description='The configurations of Alibaba Cloud Service Mesh (ASM).'),
    network?: {
      clusterDomain?: string(name='ClusterDomain', description='The domain name of the master instance.', example='cluster.local'),
      IPStack?: string(name='IPStack', description='The IP version that is supported by the master instance. Valid values:

*   ipv4: IPv4.
*   ipv6: IPv6.
*   dual: IPv4 and IPv6.', example='ipv4'),
      securityGroupIDs?: [ string ](name='SecurityGroupIDs', description='The IDs of the associated security groups.'),
      vSwitches?: [ string ](name='VSwitches', description='The details of the vSwitches.'),
      vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) in which the master instance resides.', example='vpc-f8ziib1019r9o0hdv2***'),
    }(name='Network', description='The network configurations of the master instance.'),
    workflowConfig?: {
      argoServerEnabled?: boolean(name='ArgoServerEnabled', description='Specifies whether to enable the workflow instance UI. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
      priceLimit?: string(name='PriceLimit', description='The limit on the prices of containers in the workflow. This parameter takes effect only if the WorkflowScheduleMode parameter is set to cost-optimized.', example='0.08'),
      workflowScheduleMode?: string(name='WorkflowScheduleMode', description='The scheduling mode of the workflow. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   cost-optimized: cost-prioritized scheduling mode.
*   stock-optimized: inventory-prioritized scheduling mode.', example='cost-optimized'),
      workflowUnits?: [ 
        {
          regionId?: string(name='RegionId', description='The region ID of the cluster.

>  You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent region list.', example='cn-beijing'),
          vSwitches?: [ 
            {
              vswitchId?: string(name='VswitchId', description='The ID of the vSwitch.', example='vsw-wz9sf0hsuizl7bxnj****'),
              zoneId?: string(name='ZoneId', description='The zone ID of the cluster.

> You can call the [DescribeRegions](https://help.aliyun.com/document_detail/143074.html) operation to query the most recent zone list.', example='cn-hangzhou-e'),
            }
          ](name='VSwitches', description='The vSwitches.'),
          vpcId?: string(name='VpcId', description='The ID of the VPC.', example='vpc-f8zukabbkv5aw7zkm****'),
        }
      ](name='WorkflowUnits', description='The Argo workflow regions  configuration.'),
    }(name='WorkflowConfig', description='The Argo workflow configuration.'),
  }(name='Cluster', description='The details of the master instance.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='52C1B7DF-96C1-5214-97B6-1B0859FEAFE5'),
}

model DescribeHubClusterDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHubClusterDetailsResponseBody(name='body'),
}

/**
 * @summary Queries the details of a master instance in Alibaba Cloud Distributed Cloud Container Platform (ACK One).
 *
 * @param request DescribeHubClusterDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHubClusterDetailsResponse
 */
async function describeHubClusterDetailsWithOptions(request: DescribeHubClusterDetailsRequest, runtime: Util.RuntimeOptions): DescribeHubClusterDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHubClusterDetails',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the details of a master instance in Alibaba Cloud Distributed Cloud Container Platform (ACK One).
 *
 * @param request DescribeHubClusterDetailsRequest
 * @return DescribeHubClusterDetailsResponse
 */
async function describeHubClusterDetails(request: DescribeHubClusterDetailsRequest): DescribeHubClusterDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHubClusterDetailsWithOptions(request, runtime);
}

model DescribeHubClusterKubeconfigRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='c102fe5f1ee5d4c87a68121a77d8b****'),
  privateIpAddress?: boolean(name='PrivateIpAddress', description='Specifies whether to obtain the kubeconfig file that is used to connect to the cluster over the internal network. Valid values:

*   `true`: obtains the kubeconfig file that is used to connect to the master instance over the internal network.
*   `false`: obtains the kubeconfig file that is used to connect to the master instance over the Internet.

Default value: `false`', example='false'),
}

model DescribeHubClusterKubeconfigResponseBody = {
  kubeconfig?: string(name='Kubeconfig', description='The content of the kubeconfig file.', example='"\\\\napiVersion: v1\\\\nclusters:\\\\n- cluster:\\\\n    server: https://172.16.11.***:6443\\\\n    certificate-authority-data: LS0tLS1CRU=...\\\\n  name: kubernetes\\\\ncontexts:\\\\n- context:\\\\n    cluster: kubernetes\\\\n    user: \\\\"kubernetes-a****\\\\"\\\\n  name: kubernetes-admin-cc2cbf5802bec4bfa9fae4014d8c****\\\\ncurrent-context: kubernetes-admin-cc2cbf5802bec4bfa9fae4014d8c9****\\\\nkind: Config\\\\npreferences: {}\\\\nusers:\\\\n- name: \\\\"kubernetes-admin\\\\"\\\\n  user:\\\\n    client-certificate-data: LS0tLS1CRU...\\\\n    client-key-data: LS0tCg==...\\\\n"'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='5BE4C329-DCC2-5B61-8F66-112B7D7FC712'),
}

model DescribeHubClusterKubeconfigResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHubClusterKubeconfigResponseBody(name='body'),
}

/**
 * @summary Queries the kubeconfig file of a Distributed Cloud Container Platform for Kubernetes (ACK One) cluster. In addition to the Container Service for Kubernetes (ACK) console, you can also use the Kubernetes CLI kubectl to manage clusters and applications. If you use kubectl to manage an ACK cluster, you must obtain the kubeconfig file of the cluster and use kubectl to connect to the cluster.
 *
 * @param request DescribeHubClusterKubeconfigRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHubClusterKubeconfigResponse
 */
async function describeHubClusterKubeconfigWithOptions(request: DescribeHubClusterKubeconfigRequest, runtime: Util.RuntimeOptions): DescribeHubClusterKubeconfigResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.privateIpAddress)) {
    query['PrivateIpAddress'] = request.privateIpAddress;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHubClusterKubeconfig',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the kubeconfig file of a Distributed Cloud Container Platform for Kubernetes (ACK One) cluster. In addition to the Container Service for Kubernetes (ACK) console, you can also use the Kubernetes CLI kubectl to manage clusters and applications. If you use kubectl to manage an ACK cluster, you must obtain the kubeconfig file of the cluster and use kubectl to connect to the cluster.
 *
 * @param request DescribeHubClusterKubeconfigRequest
 * @return DescribeHubClusterKubeconfigResponse
 */
async function describeHubClusterKubeconfig(request: DescribeHubClusterKubeconfigRequest): DescribeHubClusterKubeconfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHubClusterKubeconfigWithOptions(request, runtime);
}

model DescribeHubClusterLogsRequest {
  clusterId?: string(name='ClusterId', description='The ID of the Fleet instance. You can call the [DescribeHubClusters](https://help.aliyun.com/document_detail/424404.html) operation to query the created Fleet instances.

This parameter is required.', example='c9cb1d933b2ab47ff9cd25571477dc8f2'),
}

model DescribeHubClusterLogsResponseBody = {
  logs?: [ 
    {
      clusterId?: string(name='ClusterId', description='The ID of the Fleet instance.', example='c102fe5f1ee5d4c87a68121a77d8b0f38'),
      clusterLog?: string(name='ClusterLog', description='The log of the Fleet instance.', example='Cluster Created'),
      creationTime?: string(name='CreationTime', description='The time when the log was created. The time follows the ISO 8601 standard in the *yyyy-MM-dd*T*HH:mm:ss*Z format. The time is displayed in UTC.', example='2021-12-02T11:48:15+08:00'),
      logLevel?: string(name='LogLevel', description='The log level. Valid values:

*   error
*   warn
*   info', example='INFO'),
    }
  ](name='Logs', description='The details of operations logs.'),
  requestId?: string(name='RequestId', description='The request ID.', example='661192D7-25A6-54C2-B643-1129CB7D2768'),
}

model DescribeHubClusterLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHubClusterLogsResponseBody(name='body'),
}

/**
 * @summary Queries the logs of the Fleet instance of a multi-cluster fleet of Distributed Cloud Container Platform for Kubernetes (ACK One).
 *
 * @param request DescribeHubClusterLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHubClusterLogsResponse
 */
async function describeHubClusterLogsWithOptions(request: DescribeHubClusterLogsRequest, runtime: Util.RuntimeOptions): DescribeHubClusterLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHubClusterLogs',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the logs of the Fleet instance of a multi-cluster fleet of Distributed Cloud Container Platform for Kubernetes (ACK One).
 *
 * @param request DescribeHubClusterLogsRequest
 * @return DescribeHubClusterLogsResponse
 */
async function describeHubClusterLogs(request: DescribeHubClusterLogsRequest): DescribeHubClusterLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHubClusterLogsWithOptions(request, runtime);
}

model DescribeHubClustersRequest {
  profile?: string(name='Profile', description='The configurations of the cluster.', example='Default'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekz77rhypeu***'),
  tag?: [
    Tag
  ](name='Tag', description='The tags.'),
}

model DescribeHubClustersShrinkRequest {
  profile?: string(name='Profile', description='The configurations of the cluster.', example='Default'),
  resourceGroupId?: string(name='ResourceGroupId', description='The resource group ID.', example='rg-aekz77rhypeu***'),
  tagShrink?: string(name='Tag', description='The tags.'),
}

model DescribeHubClustersResponseBody = {
  clusters?: [ 
    {
      apiServer?: {
        apiServerEipId?: string(name='ApiServerEipId', description='The elastic IP address (EIP) ID.', example='eip-xxx'),
        enabledPublic?: boolean(name='EnabledPublic', description='Indicates whether the public endpoint is enabled for the API server. Valid values:

*   true
*   false', example='true'),
        loadBalancerId?: string(name='LoadBalancerId', description='The ID of the Server Load Balancer (SLB) instance that is associated with the cluster.', example='lb-bp1qyp4l6bscqxw69****'),
      }(name='ApiServer', description='The information about the API server.'),
      clusterInfo?: {
        clusterId?: string(name='ClusterId', description='The cluster ID.', example='c2d3e0121ea214b438010502a8019****'),
        clusterSpec?: string(name='ClusterSpec', description='The specifications of the cluster.

*   Only ack.pro.small may be returned.', example='ack.pro.small'),
        creationTime?: string(name='CreationTime', description='The time when the cluster was created.', example='2021-11-05T10:25:48Z'),
        errorMessage?: string(name='ErrorMessage', description='The error message that is returned if the cluster failed to be created.', example='Success'),
        name?: string(name='Name', description='The cluster name.', example='ackone-heyuan'),
        profile?: string(name='Profile', description='The configurations of the cluster.', example='Default'),
        regionId?: string(name='RegionId', description='The region ID.', example='cn-beijing'),
        resourceGroupID?: string(name='ResourceGroupID', description='The resource group ID.', example='rg-qh2zgjsdv52***'),
        state?: string(name='State', description='The state of the cluster. Valid values:

*   initial: The cluster is being initialized.
*   failed: The cluster failed to be created.
*   running: The cluster is running
*   inactive: The cluster is not activated.
*   deleting: The cluster is being deleted.
*   delete_failed: The cluster failed to be deleted.
*   deleted: The cluster is deleted.', example='running'),
        tags?: [ 
          {
            key?: string(name='Key', description='The tag key.', example='headername'),
            value?: string(name='Value', description='The tag value.', example='release'),
          }
        ](name='Tags', description='The tags.'),
        updateTime?: string(name='UpdateTime', description='The time when the cluster was last modified.', example='2021-09-02T13:39:50Z'),
        version?: string(name='Version', description='The version of the cluster.', example='1.22.3-aliyun.1'),
      }(name='ClusterInfo', description='The details of the cluster.'),
      conditions?: [ 
        {
          message?: string(name='Message', description='The error message returned.', example='Successful!'),
          reason?: string(name='Reason', description='The reason for the deletion condition.', example='Successful'),
          status?: string(name='Status', description='The state of the cluster that the deletion condition indicates. Valid values:

*   True: The cluster cannot be deleted.
*   False: The cluster can be deleted.
*   Unknow: Whether the cluster can be deleted is unknown.', example='True'),
          type?: string(name='Type', description='The type of deletion condition.', example='DeletionProtection'),
        }
      ](name='Conditions', description='The deletion conditions of the cluster.'),
      endpoints?: {
        intranetApiServerEndpoint?: string(name='IntranetApiServerEndpoint', description='The internal endpoint of the API server.', example='https://172.16.6.**:6443'),
        publicApiServerEndpoint?: string(name='PublicApiServerEndpoint', description='The public endpoint of the API server.', example='https://123.57.21.***:6443'),
      }(name='Endpoints', description='The endpoints of the cluster.'),
      logConfig?: {
        enableLog?: boolean(name='EnableLog', description='Indicates whether the audit logging feature is enabled. Valid values:

*   true
*   false', example='true'),
        logProject?: string(name='LogProject', description='The name of the project in Simple Log Service.', example='audit-log-abc'),
        logStoreTTL?: string(name='LogStoreTTL', description='The number of days that logs are retained by Simple Log Service.', example='7'),
      }(name='LogConfig', description='The logging configurations.'),
      meshConfig?: {
        enableMesh?: boolean(name='EnableMesh', description='Indicates whether ASM is enabled. Valid values:

*   true
*   false', example='false'),
        meshId?: string(name='MeshId', description='The ASM instance ID.', example='c2d3e0121ea214b438010502a8019****'),
      }(name='MeshConfig', description='The configurations of Alibaba Cloud Service Mesh (ASM).'),
      network?: {
        clusterDomain?: string(name='ClusterDomain', description='The domain name of the cluster.', example='cluster.local'),
        securityGroupIDs?: [ string ](name='SecurityGroupIDs', description='The security group IDs.'),
        vSwitches?: [ string ](name='VSwitches', description='The IDs of vSwitches to which the cluster belongs.'),
        vpcId?: string(name='VpcId', description='The ID of the virtual private cloud (VPC) to which the cluster belongs.', example='vpc-2zeusrwi7c2mlww4a****'),
      }(name='Network', description='The network configurations of the cluster.'),
    }
  ](name='Clusters', description='The information about clusters.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='2D676EFC-8C04-5CCE-A08E-BB97D24B47E8'),
}

model DescribeHubClustersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeHubClustersResponseBody(name='body'),
}

/**
 * @summary Queries the Distributed Cloud Container Platform for Kubernetes (ACK One) clusters that are created by the current user.
 *
 * @param tmpReq DescribeHubClustersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeHubClustersResponse
 */
async function describeHubClustersWithOptions(tmpReq: DescribeHubClustersRequest, runtime: Util.RuntimeOptions): DescribeHubClustersResponse {
  Util.validateModel(tmpReq);
  var request = new DescribeHubClustersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.tag)) {
    request.tagShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.tag, 'Tag', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.profile)) {
    query['Profile'] = request.profile;
  }
  if (!Util.isUnset(request.resourceGroupId)) {
    query['ResourceGroupId'] = request.resourceGroupId;
  }
  if (!Util.isUnset(request.tagShrink)) {
    query['Tag'] = request.tagShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeHubClusters',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries the Distributed Cloud Container Platform for Kubernetes (ACK One) clusters that are created by the current user.
 *
 * @param request DescribeHubClustersRequest
 * @return DescribeHubClustersResponse
 */
async function describeHubClusters(request: DescribeHubClustersRequest): DescribeHubClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeHubClustersWithOptions(request, runtime);
}

model DescribeManagedClustersRequest {
  clusterId?: string(name='ClusterId', description='The status of the association between the clusters and Service Mesh (ASM).

This parameter is required.', example='c2f41fd4599454a9c9ad8b3daafe873ad'),
}

model DescribeManagedClustersResponseBody = {
  clusters?: [ 
    {
      cluster?: {
        clusterID?: string(name='ClusterID', description='Information about the master instance.', example='c2f41fd4599454a9c9ad8b3daafe873ad'),
        clusterSpec?: string(name='ClusterSpec', description='The ID of the master instance.', example='ack.pro.small'),
        clusterType?: string(name='ClusterType', description='The time when the master instance was created.', example='One'),
        created?: string(name='Created', description='The ID of the master instance.', example='2022-03-23T06:22:28Z'),
        currentVersion?: string(name='CurrentVersion', description='The name of the master instance.', example='1.22.3-aliyun.1'),
        initVersion?: string(name='InitVersion', description='The specification of the master instance. Valid values: - ack.pro.small: ACK Pro.', example='1.20.4-aliyun.1'),
        name?: string(name='Name', description='The status information.', example='ackone-heyuan'),
        profile?: string(name='Profile', description='The ID of the request.', example='Default'),
        region?: string(name='Region', description='The ID of the master instance.', example='cn-hangzhou'),
        resourceGroupId?: string(name='ResourceGroupId', description='The name of the master instance.', example='rg-acfmx7o7ewyqcby'),
        state?: string(name='State', description='The current Kubernetes version of the master instance.', example='running'),
        updated?: string(name='Updated', description='The ID of the vSwitch.', example='2022-03-23T06:22:28Z'),
        vSwitchID?: string(name='VSwitchID', description='The original Kubernetes version of the master instance.', example='vsw-m5e0pbkgmhvzecf7enfym'),
        vpcID?: string(name='VpcID', description='The status of the association between the clusters and the master instance. Valid values: - Installing: The clusters are being associated with the master instance. - Successed: The clusters are associated with the master instance. - Failed: The clusters failed to be associated with the master instance. - Deleting: The clusters are being disassociated from the master instance. - Deleted: The clusters are disassociated from the master instance.', example='vpc-bp1fhizs9fxuvit06zeb9'),
      }(name='Cluster', description='The name of the master instance.'),
      meshStatus?: {
        inMesh?: boolean(name='InMesh', example='true'),
      }(name='MeshStatus', description='Zhishi'),
      status?: {
        message?: string(name='Message', description='Query the clusters that are associated with a master instance.', example='SUCCESS'),
        state?: string(name='State', description='You can call the DescribeManagedClusters operation to query the clusters that are associated with a master instance.', example='Successed'),
      }(name='Status', description='Example 1'),
    }
  ](name='Clusters', description='The status of the associated clusters. Valid values: - initial: The associated clusters are being initialized. - failed: The associated clustersfailed to be created. - running: The associated clusters are running. - inactive: The associated clusters are inactive. - deleting: The associated clusters are being deleted. - deleted: The associated clusters are deleted.'),
  requestId?: string(name='RequestId', description='VPC ID', example='BDA85C7A-FC81-56C4-9BC2-9112EE970059'),
}

model DescribeManagedClustersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeManagedClustersResponseBody(name='body'),
}

/**
 * @summary Alibaba Cloud CLI allows you to search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.
 *
 * @param request DescribeManagedClustersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeManagedClustersResponse
 */
async function describeManagedClustersWithOptions(request: DescribeManagedClustersRequest, runtime: Util.RuntimeOptions): DescribeManagedClustersResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeManagedClusters',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Alibaba Cloud CLI allows you to search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.
 *
 * @param request DescribeManagedClustersRequest
 * @return DescribeManagedClustersResponse
 */
async function describeManagedClusters(request: DescribeManagedClustersRequest): DescribeManagedClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeManagedClustersWithOptions(request, runtime);
}

model DescribePoliciesResponseBody = {
  policies?: [ 
    {
      category?: string(name='Category', description='The policy type.', example='psp'),
      names?: [ string ](name='Names', description='The names of the policies of each policy type.'),
    }
  ](name='Policies', description='A list of policies.'),
  requestId?: string(name='RequestId', description='The request ID.', example='9439169C-64C1-5849-9F7C-E3E60BDDEF7A'),
}

model DescribePoliciesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePoliciesResponseBody(name='body'),
}

/**
 * @summary Queries a list of policies.
 *
 * @param request DescribePoliciesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePoliciesResponse
 */
async function describePoliciesWithOptions(runtime: Util.RuntimeOptions): DescribePoliciesResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'DescribePolicies',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries a list of policies.
 *
 * @return DescribePoliciesResponse
 */
async function describePolicies(): DescribePoliciesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePoliciesWithOptions(runtime);
}

model DescribePolicyDetailsRequest {
  policyName?: string(name='PolicyName', description='The policy name.', example='ACKAllowedRepos'),
}

model DescribePolicyDetailsResponseBody = {
  policy?: {
    action?: string(name='Action', description='The action of the policy. Valid values:

*   enforce: blocks deployments that match the policy.
*   inform: generates alerts for deployments that match the policy.', example='enforce'),
    category?: string(name='Category', description='The type of the policy.', example='k8s-general'),
    created?: string(name='Created', description='The time when the policy was created.', example='2021-11-18T10:52:17+08:00'),
    description?: string(name='Description', description='The description of the policy.', example='Requires container images to begin with a repo string from a specified list'),
    name?: string(name='Name', description='The name of the policy.', example='ACKAllowedRepos'),
    noConfig?: int32(name='NoConfig', description='Indicates whether parameters are required. Valid values:

*   0: Parameters are required.
*   1: Parameters are not required.', example='0'),
    severity?: string(name='Severity', description='The severity level of the policy.', example='high'),
    template?: string(name='Template', description='The content of the policy.', example='The content of the policy.'),
    updated?: string(name='Updated', description='The time when the policy was last updated.', example='2021-11-18T10:52:17+08:00'),
  }(name='Policy', description='The policies.'),
  requestId?: string(name='RequestId', description='The request ID.', example='2D676EFC-8C04-5CCE-A08E-BB97D24B47E8'),
}

model DescribePolicyDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePolicyDetailsResponseBody(name='body'),
}

/**
 * @summary Queries detailed information about a policy.
 *
 * @param request DescribePolicyDetailsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePolicyDetailsResponse
 */
async function describePolicyDetailsWithOptions(request: DescribePolicyDetailsRequest, runtime: Util.RuntimeOptions): DescribePolicyDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.policyName)) {
    query['PolicyName'] = request.policyName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePolicyDetails',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries detailed information about a policy.
 *
 * @param request DescribePolicyDetailsRequest
 * @return DescribePolicyDetailsResponse
 */
async function describePolicyDetails(request: DescribePolicyDetailsRequest): DescribePolicyDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePolicyDetailsWithOptions(request, runtime);
}

model DescribePolicyGovernanceInClusterRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c09946603cd764dac96135f51d1ba****'),
}

model DescribePolicyGovernanceInClusterResponseBody = {
  policyGovernances?: [ 
    {
      cluster?: {
        clusterId?: string(name='ClusterId', description='The ID of the associated cluster.', example='ca5cf1b5edb5c4736a6ea0dfb4061****'),
        clusterSpec?: string(name='ClusterSpec', description='The specifications of the associated cluster.', example='ack.pro.small'),
        clusterType?: string(name='ClusterType', description='The type of the associated cluster.', example='ManagedKubernetes'),
        name?: string(name='Name', description='The name of the associated cluster.', example='ack-001'),
        profile?: string(name='Profile', description='The identifier of the associated cluster.', example='Default'),
        regionId?: string(name='RegionId', description='The region ID of the associated cluster.', example='cn-heyuan'),
        state?: string(name='State', description='The status of the associated cluster.', example='running'),
      }(name='Cluster', description='The information about the associated clusters in which the policies are deployed.'),
      policyGovernance?: {
        admitLog?: {
          count?: string(name='Count', description='The number of log entries in the query result.', example='100'),
          logProject?: string(name='LogProject', description='The name of the Log Service project.', example='demo'),
          logStore?: string(name='LogStore', description='The name of the Logstore.', example='demo'),
          logs?: [ map[string]string ](name='Logs', description='The content of the audit log.'),
          progress?: string(name='Progress', description='The status of the query. Valid values:

*   Complete: The query is successful, and the complete result is returned.
*   Incomplete: The query is successful, but the query result is incomplete. To obtain the complete result, you must call the operation again.', example='Complete'),
        }(name='AdmitLog', description='The audit log generated by the associated cluster.'),
        onState?: [ 
          {
            enabledCount?: long(name='EnabledCount', description='The types of policies that are enabled in the associated cluster.', example='2'),
            severity?: string(name='Severity', description='The severity level.', example='low'),
            totalCount?: long(name='TotalCount', description='The types of policies of each severity level.', example='2'),
          }
        ](name='OnState', description='The number of policies of each severity level enabled in the associated cluster.'),
        violation?: {
          totalViolations?: {
            deny?: [ 
              {
                severity?: string(name='Severity', description='The severity level.', example='low'),
                violations?: long(name='Violations', description='The number of deployments that are blocked.', example='2'),
              }
            ](name='Deny', description='The information about the deployments that are blocked.'),
            warn?: [ 
              {
                severity?: string(name='Severity', description='The severity level.', example='low'),
                violations?: string(name='Violations', description='The number of deployments that have triggered alerting.', example='2'),
              }
            ](name='Warn', description='The information about the deployments that have triggered alerting.'),
          }(name='TotalViolations', description='The number of deployments that match the policies in the associated cluster, including deployments that are blocked and deployments that have triggered alerting. The deployments are classified by severity level.'),
          violations?: {
            deny?: [ 
              {
                policyDescription?: string(name='PolicyDescription', description='The description of the policy.', example='Restricts secrets used in pod envs'),
                policyName?: string(name='PolicyName', description='The name of the policy.', example='ACKPSPCapabilities'),
                severity?: string(name='Severity', description='The severity level of the policy.', example='low'),
                violations?: long(name='Violations', description='The number of times that the policy blocks deployments.', example='2'),
              }
            ](name='Deny', description='The information about the deployments that are blocked.'),
            warn?: [ 
              {
                policyDescription?: string(name='PolicyDescription', description='The description of the policy.', example='Restricts secrets used in pod envs'),
                policyName?: string(name='PolicyName', description='The name of the policy.', example='ACKPSPCapabilities'),
                severity?: string(name='Severity', description='The severity level of the policy.', example='low'),
                violations?: long(name='Violations', description='The number of times that the policy generates alerts.', example='2'),
              }
            ](name='Warn', description='The information about the deployments that have triggered alerting.'),
          }(name='Violations', description='The number of deployments that match the policies in the associated cluster, including deployments that are blocked and deployments that have triggered alerting. The deployments are classified by policy type.'),
        }(name='Violation', description='The number of deployments that match the policies in the associated cluster, including deployments that are blocked and deployments that have triggered alerting.'),
      }(name='PolicyGovernance', description='The detailed policy information.'),
    }
  ](name='PolicyGovernances', description='The detailed information about the policies.'),
  requestId?: string(name='RequestId', description='The request ID.', example='96C6A284-0EC3-5486-9A97-E8E9EE27E9EF'),
}

model DescribePolicyGovernanceInClusterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePolicyGovernanceInClusterResponseBody(name='body'),
}

/**
 * @summary Queries detailed information about the policies used by the clusters that are associated with a master instance.
 *
 * @param request DescribePolicyGovernanceInClusterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePolicyGovernanceInClusterResponse
 */
async function describePolicyGovernanceInClusterWithOptions(request: DescribePolicyGovernanceInClusterRequest, runtime: Util.RuntimeOptions): DescribePolicyGovernanceInClusterResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePolicyGovernanceInCluster',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries detailed information about the policies used by the clusters that are associated with a master instance.
 *
 * @param request DescribePolicyGovernanceInClusterRequest
 * @return DescribePolicyGovernanceInClusterResponse
 */
async function describePolicyGovernanceInCluster(request: DescribePolicyGovernanceInClusterRequest): DescribePolicyGovernanceInClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePolicyGovernanceInClusterWithOptions(request, runtime);
}

model DescribePolicyInstancesRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c102fe5f1ee5d4c87a68121a77d8b****'),
  policyName?: string(name='PolicyName', description='The name of the policy.

This parameter is required.', example='ACKNoEnvVarSecrets'),
}

model DescribePolicyInstancesResponseBody = {
  policies?: [ 
    {
      clusterId?: string(name='ClusterId', description='The ID of the associated cluster.', example='cd0e6882394f7496589837cac3585****'),
      instanceName?: string(name='InstanceName', description='The name of the policy instance.', example='no-env-var-secrets-****'),
      policyAction?: string(name='PolicyAction', description='The action of the policy. Valid values:

*   deny: blocks deployments that match the policy.
*   warn: generates alerts for deployments that match the policy.', example='warn'),
      policyCategory?: string(name='PolicyCategory', description='The type of the policy.', example='k8s-general'),
      policyDescription?: string(name='PolicyDescription', description='The description of the policy.', example='Restricts secrets used in pod envs'),
      policyName?: string(name='PolicyName', description='The name of the policy.', example='ACKPSPCapabilities'),
      policyParameters?: map[string]string(name='PolicyParameters', description='The parameters of the policy instance.'),
      policyScope?: string(name='PolicyScope', description='The applicable scope of the policy instance.

A value of \\\\* indicates all namespaces. This is the default value.

Multiple namespaces are separated by commas (,).', example='*'),
      policySeverity?: string(name='PolicySeverity', description='The severity level of the policy.', example='low'),
      totalViolations?: long(name='TotalViolations', description='The total number of deployments that match the policy in the associated cluster, including the deployments that are blocked and the deployments that have triggered alerting.', example='2'),
    }
  ](name='Policies', description='A list of policy instances.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5BE4C329-DCC2-5B61-8F66-112B7D7FC712'),
}

model DescribePolicyInstancesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePolicyInstancesResponseBody(name='body'),
}

/**
 * @summary Queries policy instances that are deployed in the clusters associated with a master instance.
 *
 * @param request DescribePolicyInstancesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePolicyInstancesResponse
 */
async function describePolicyInstancesWithOptions(request: DescribePolicyInstancesRequest, runtime: Util.RuntimeOptions): DescribePolicyInstancesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.policyName)) {
    query['PolicyName'] = request.policyName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePolicyInstances',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries policy instances that are deployed in the clusters associated with a master instance.
 *
 * @param request DescribePolicyInstancesRequest
 * @return DescribePolicyInstancesResponse
 */
async function describePolicyInstances(request: DescribePolicyInstancesRequest): DescribePolicyInstancesResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePolicyInstancesWithOptions(request, runtime);
}

model DescribePolicyInstancesStatusRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c676decda7b8148d69a9aba751877****'),
}

model DescribePolicyInstancesStatusResponseBody = {
  policies?: {
    policyInstances?: [ 
      {
        policyCategory?: string(name='PolicyCategory', description='The type of the policy.', example='compliance'),
        policyClusters?: [ 
          {
            clusterId?: string(name='ClusterId', description='The cluster ID.', example='c639e5310e73e4a29ab18d6330a633****'),
            status?: string(name='Status', description='The status of the policy deployment.', example='Success'),
          }
        ](name='PolicyClusters', description='The associated clusters in which the policy instances are deployed.'),
        policyDescription?: string(name='PolicyDescription', description='The description of the policy.', example='Restricts use of the cluster-admin role.'),
        policyInstancesCount?: long(name='PolicyInstancesCount', description='The number of policy instances that are deployed. If this parameter is left empty, no policy instance is deployed.', example='2'),
        policyName?: string(name='PolicyName', description='The policy name.', example='ACKRestrictRoleBindings'),
        policySeverity?: string(name='PolicySeverity', description='The severity level of the policy.', example='low'),
      }
    ](name='PolicyInstances', description='The number of policy instances of each policy type.'),
    severityInfo?: [ 
      {
        severityCount?: string(name='SeverityCount', description='The number of policy instances.', example='2'),
        severityType?: string(name='SeverityType', description='The severity level of the policy.', example='low'),
      }
    ](name='SeverityInfo', description='The number of policy instances that are deployed in the cluster.'),
  }(name='Policies', description='The number of policy instances of each policy type.'),
  requestId?: string(name='RequestId', description='The request ID.', example='5D89C59A-A7EB-5BF8-B094-6479175346CA'),
}

model DescribePolicyInstancesStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribePolicyInstancesStatusResponseBody(name='body'),
}

/**
 * @summary Queries detailed information about policy instances that are deployed in the clusters associated with a master instance.
 *
 * @param request DescribePolicyInstancesStatusRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribePolicyInstancesStatusResponse
 */
async function describePolicyInstancesStatusWithOptions(request: DescribePolicyInstancesStatusRequest, runtime: Util.RuntimeOptions): DescribePolicyInstancesStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribePolicyInstancesStatus',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Queries detailed information about policy instances that are deployed in the clusters associated with a master instance.
 *
 * @param request DescribePolicyInstancesStatusRequest
 * @return DescribePolicyInstancesStatusResponse
 */
async function describePolicyInstancesStatus(request: DescribePolicyInstancesStatusRequest): DescribePolicyInstancesStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return describePolicyInstancesStatusWithOptions(request, runtime);
}

model DescribeRegionsRequest {
  language?: string(name='Language', description='The language. Valid values: zh and en.', example='en'),
}

model DescribeRegionsResponseBody = {
  regions?: [ 
    {
      localName?: string(name='LocalName', description='The name of the region.', example='China (Beijing)'),
      regionId?: string(name='RegionId', description='The ID of the region.', example='cn-beijing'),
    }
  ](name='Regions', description='A list of available regions that are returned.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='C0EE05F4-6C1D-5993-B028-B569F9ED6B51'),
}

model DescribeRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeRegionsResponseBody(name='body'),
}

/**
 * @summary 查询地域列表
 *
 * @param request DescribeRegionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeRegionsResponse
 */
async function describeRegionsWithOptions(request: DescribeRegionsRequest, runtime: Util.RuntimeOptions): DescribeRegionsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeRegions',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询地域列表
 *
 * @param request DescribeRegionsRequest
 * @return DescribeRegionsResponse
 */
async function describeRegions(request: DescribeRegionsRequest): DescribeRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeRegionsWithOptions(request, runtime);
}

model DescribeUserPermissionsRequest {
  userId?: string(name='UserId', description='The ID of the RAM user that you want to query.

This parameter is required.', example='21175****', nullable=false),
}

model DescribeUserPermissionsResponseBody = {
  permissions?: [ 
    {
      resourceId?: string(name='ResourceId', description='The authorization setting. Valid values:

*   {cluster_id} is returned if the permissions are scoped to a cluster.
*   {cluster_id}/{namespace} is returned if the permissions are scoped to a namespace of a cluster.
*   all-clusters is returned if the permissions are scoped to all clusters.', example='cffef3c9c7ba145b083292942a2c3****'),
      resourceType?: string(name='ResourceType', description='The authorization type. Valid values:

*   cluster: indicates that the permissions are scoped to a cluster.
*   namespace: indicates that the permissions are scoped to a namespace of a cluster.', example='cluster'),
      roleName?: string(name='RoleName', description='The name of the custom role. If a custom role is assigned, the value is the name of the assigned custom role.', example='view'),
      roleType?: string(name='RoleType', description='The type of predefined role. Valid values:

*   admin: administrator
*   dev: developer', example='dev'),
    }
  ](name='Permissions', description='The details about the permissions of the RAM user.'),
  requestId?: string(name='RequestId', description='The ID of the request.', example='EA06613B-37A3-549E-BAE0-E4AD8A6E93D7'),
}

model DescribeUserPermissionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeUserPermissionsResponseBody(name='body'),
}

/**
 * @summary Query the permissions of a Resource Access Management (RAM) user.
 *
 * @param request DescribeUserPermissionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeUserPermissionsResponse
 */
async function describeUserPermissionsWithOptions(request: DescribeUserPermissionsRequest, runtime: Util.RuntimeOptions): DescribeUserPermissionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeUserPermissions',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Query the permissions of a Resource Access Management (RAM) user.
 *
 * @param request DescribeUserPermissionsRequest
 * @return DescribeUserPermissionsResponse
 */
async function describeUserPermissions(request: DescribeUserPermissionsRequest): DescribeUserPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeUserPermissionsWithOptions(request, runtime);
}

model DetachClusterFromHubRequest {
  clusterId?: string(name='ClusterId', description='The ID of the request.

This parameter is required.', example='cb09fda0dc2f94a8397c76638c7ec****'),
  clusterIds?: string(name='ClusterIds', description='The operation that you want to perform. Set the value to **DetachClusterFromHub**.

This parameter is required.', example='["c1c731554c1ec4a1ca9bb690ff9ed****"]'),
  detachFromMesh?: boolean(name='DetachFromMesh', description='Example 1', example='false'),
}

model DetachClusterFromHubResponseBody = {
  clusterId?: string(name='ClusterId', description='Zhishi', example='cc490b1e67ccc43a784727f29f33e****'),
  managedClusterIds?: [ string ](name='ManagedClusterIds'),
  requestId?: string(name='RequestId', description='You can call the DetachClusterFromHub operation to disassociate clusters from a master instance.', example='4412F213-DBCD-5D1B-A9A1-F6C26C6C19D9'),
  taskId?: string(name='TaskId', example='T-623a96b7bbeaac074b00****'),
}

model DetachClusterFromHubResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DetachClusterFromHubResponseBody(name='body'),
}

/**
 * @summary Alibaba Cloud CLI allows you to search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.
 *
 * @param request DetachClusterFromHubRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DetachClusterFromHubResponse
 */
async function detachClusterFromHubWithOptions(request: DetachClusterFromHubRequest, runtime: Util.RuntimeOptions): DetachClusterFromHubResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.detachFromMesh)) {
    query['DetachFromMesh'] = request.detachFromMesh;
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.clusterIds)) {
    body['ClusterIds'] = request.clusterIds;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DetachClusterFromHub',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Alibaba Cloud CLI allows you to search for API operations, call and debug API operations online, and dynamically generate executable sample code for SDKs.
 *
 * @param request DetachClusterFromHubRequest
 * @return DetachClusterFromHubResponse
 */
async function detachClusterFromHub(request: DetachClusterFromHubRequest): DetachClusterFromHubResponse {
  var runtime = new Util.RuntimeOptions{};
  return detachClusterFromHubWithOptions(request, runtime);
}

model GrantUserPermissionRequest {
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='c102fe5f1ee5d4c87a68121a77d8b****'),
  isRamRole?: boolean(name='IsRamRole', description='The entity to which the permissions are granted. A value of `true` indicates that the permissions are granted to a RAM user. A value of `false` indicates that the permissions are granted to a RAM role.', example='false'),
  namespace?: string(name='Namespace', description='The name of the namespace.

*   If **RoleType** is set to **cluster**, you do not need to specify this parameter.
*   This parameter is required if **RoleType** is set to **namespace**.
*   If **RoleType** is set to **namespace** and **RoleName** is set to **gitops-dev**, this parameter is required and must be set to **argocd**.', example='default'),
  roleName?: string(name='RoleName', description='The predefined role. Valid values:

*   admin: administrator
*   dev: developer
*   gitops-dev: GitOps developer. The parameter is available only for Fleet instances.

The value of RoleName and that of RoleType must meet the following requirements:

*   If **RoleType** is set to **cluster**, this parameter must be set to **admin**.
*   If **RoleType** is set to **namespace**, this parameter must be set to **dev** or **gitops-dev**.

This parameter is required.', example='admin'),
  roleType?: string(name='RoleType', description='The authorization type. Valid values:

*   cluster: The permissions are granted to a cluster.
*   namespace: The permissions are granted to a namespace of a cluster.

This parameter is required.', example='cluster'),
  userId?: string(name='UserId', description='The ID of the RAM user or RAM role.

This parameter is required.', example='2176****'),
}

model GrantUserPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='2D676EFC-8C04-5CCE-A08E-BB97D24B47E8'),
}

model GrantUserPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GrantUserPermissionResponseBody(name='body'),
}

/**
 * @summary Grants role-based access control (RBAC) permissions to Resource Access Management (RAM) users or RAM roles. System policies can be attached to RAM users to grant only the operation permissions on Distributed Cloud Container Platform for Kubernetes (ACK One) cluster resources. The operation permissions include creating and viewing instances. If you want to perform operations on Kubernetes resources in a specific cluster by using a RAM user or assuming a RAM role, such as creating GitOps applications and Argo workflows, you must grant RBAC permissions to the RAM user or RAM role to perform operations on the specified ACK One cluster and namespace. This topic describes how to grant RBAC permissions to a RAM user or RAM role.
 *
 * @description *   To call this API operation to grant permissions to a RAM user or RAM role on a specific cluster, you must use an Alibaba Cloud account, the account that is used to create the cluster, or a RAM user that has the cluster administrator permissions. A regular RAM user does not have the permissions to call this operation.
 * *   Before you grant RBAC permissions to a RAM user or RAM role on a cluster, you must grant the operation permissions to the RAM user or RAM role on the specified cluster. For more information, see [Attach a system permission policy to a RAM user or RAM role](https://help.aliyun.com/document_detail/613486.html).
 * For more information, see [Authorization overview](https://help.aliyun.com/document_detail/613468.html).
 *
 * @param request GrantUserPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GrantUserPermissionResponse
 */
async function grantUserPermissionWithOptions(request: GrantUserPermissionRequest, runtime: Util.RuntimeOptions): GrantUserPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.isRamRole)) {
    query['IsRamRole'] = request.isRamRole;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.roleName)) {
    query['RoleName'] = request.roleName;
  }
  if (!Util.isUnset(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantUserPermission',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Grants role-based access control (RBAC) permissions to Resource Access Management (RAM) users or RAM roles. System policies can be attached to RAM users to grant only the operation permissions on Distributed Cloud Container Platform for Kubernetes (ACK One) cluster resources. The operation permissions include creating and viewing instances. If you want to perform operations on Kubernetes resources in a specific cluster by using a RAM user or assuming a RAM role, such as creating GitOps applications and Argo workflows, you must grant RBAC permissions to the RAM user or RAM role to perform operations on the specified ACK One cluster and namespace. This topic describes how to grant RBAC permissions to a RAM user or RAM role.
 *
 * @description *   To call this API operation to grant permissions to a RAM user or RAM role on a specific cluster, you must use an Alibaba Cloud account, the account that is used to create the cluster, or a RAM user that has the cluster administrator permissions. A regular RAM user does not have the permissions to call this operation.
 * *   Before you grant RBAC permissions to a RAM user or RAM role on a cluster, you must grant the operation permissions to the RAM user or RAM role on the specified cluster. For more information, see [Attach a system permission policy to a RAM user or RAM role](https://help.aliyun.com/document_detail/613486.html).
 * For more information, see [Authorization overview](https://help.aliyun.com/document_detail/613468.html).
 *
 * @param request GrantUserPermissionRequest
 * @return GrantUserPermissionResponse
 */
async function grantUserPermission(request: GrantUserPermissionRequest): GrantUserPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantUserPermissionWithOptions(request, runtime);
}

model GrantUserPermissionsRequest {
  permissions?: [ 
    {
      clusterId?: string(name='ClusterId', description='The master instance ID.

*   When the role_type parameter is set to all-clusters, set the parameter to an empty string.', example='cf67bdb0ffcb349ecabc1ca70da78****'),
      isRamRole?: boolean(name='IsRamRole', description='The entity to which the permissions are granted. A value of `true` indicates that the permissions are granted to a RAM user. A value of `false` indicates that the permissions are granted to a RAM role.', example='true'),
      namespace?: string(name='Namespace', description='The namespace to which the permissions are scoped. By default, this parameter is empty when you set RoleType to cluster.', example='test'),
      roleName?: string(name='RoleName', description='The predefined role that you want to assign. Valid values:

*   admin: the administrator role.
*   dev: the developer role.

This parameter is required.', example='dev'),
      roleType?: string(name='RoleType', description='The authorization type. Valid values:

*   cluster: specifies that the permissions are scoped to a master instance.
*   namespace: specifies that the permissions are scoped to a namespace of a cluster.
*   all-clusters: specifies that the permissions are scoped to all master instances.

This parameter is required.', example='cluster'),
    }
  ](name='Permissions', description='The list of permissions that you want to grant to the RAM user.'),
  userId?: string(name='UserId', description='The ID of the RAM user.

This parameter is required.', example='2367****'),
}

model GrantUserPermissionsShrinkRequest {
  permissionsShrink?: string(name='Permissions', description='The list of permissions that you want to grant to the RAM user.'),
  userId?: string(name='UserId', description='The ID of the RAM user.

This parameter is required.', example='2367****'),
}

model GrantUserPermissionsResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='4412F213-DBCD-5D1B-A9A1-F6C26C6C19D9'),
}

model GrantUserPermissionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GrantUserPermissionsResponseBody(name='body'),
}

/**
 * @deprecated OpenAPI GrantUserPermissions is deprecated, please use adcp::2022-01-01::GrantUserPermission instead.
 *
 * @summary Grant permissions to a Resource Access Management (RAM) user.
 *
 * @param tmpReq GrantUserPermissionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GrantUserPermissionsResponse
 */
// Deprecated
async function grantUserPermissionsWithOptions(tmpReq: GrantUserPermissionsRequest, runtime: Util.RuntimeOptions): GrantUserPermissionsResponse {
  Util.validateModel(tmpReq);
  var request = new GrantUserPermissionsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.permissions)) {
    request.permissionsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.permissions, 'Permissions', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.permissionsShrink)) {
    query['Permissions'] = request.permissionsShrink;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GrantUserPermissions',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @deprecated OpenAPI GrantUserPermissions is deprecated, please use adcp::2022-01-01::GrantUserPermission instead.
 *
 * @summary Grant permissions to a Resource Access Management (RAM) user.
 *
 * @param request GrantUserPermissionsRequest
 * @return GrantUserPermissionsResponse
 */
// Deprecated
async function grantUserPermissions(request: GrantUserPermissionsRequest): GrantUserPermissionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return grantUserPermissionsWithOptions(request, runtime);
}

model UpdateHubClusterFeatureRequest {
  accessControlList?: [ string ](name='AccessControlList', description='The Internet access control list (ACL). This parameter takes effect only if PublicAccessEnabled is set to true.'),
  apiServerEipId?: string(name='ApiServerEipId', description='The ID of the EIP.', example='eip-xxx'),
  argoCDEnabled?: boolean(name='ArgoCDEnabled', description='Specifies whether to enable Argo CD. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  argoCDHAEnabled?: boolean(name='ArgoCDHAEnabled', description='Specifies whether to enable high availability for Argo CD. Valid values:

*   true
*   false', example='true'),
  argoEventsEnabled?: boolean(name='ArgoEventsEnabled', description='Specifies whether to enable ArgoEvents. Valid values:

- true
- false', example='true'),
  argoServerEnabled?: boolean(name='ArgoServerEnabled', description='Specifies whether to enable the workflow instance UI. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  auditLogEnabled?: boolean(name='AuditLogEnabled', description='Specifies whether to enable the audit logging feature. Valid values:

*   true: enables the audit logging feature.
*   false: disables the audit logging feature.', example='true'),
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='c46979b1075f04d99b5f2b710393e5****'),
  deletionProtection?: boolean(name='DeletionProtection', description='Specifies whether to enable the deletion protection feature for the cluster. After you enable the deletion protection feature for the cluster, you cannot delete the cluster in the console or by calling the DeleteHubCluster operation. Valid values:

*   true
*   false

Default value: false.', example='true'),
  enableMesh?: boolean(name='EnableMesh', description='Specifies whether to enable Service Mesh (ASM). Valid values:

*   true
*   false', example='true'),
  gatewayEnabled?: boolean(name='GatewayEnabled', description='Specifies whether to enable Gateway. Valid values:
- true
- false', example='true'),
  monitorEnabled?: boolean(name='MonitorEnabled', description='Specifies whether to enable the monitoring dashboard feature for the workflow instance. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  name?: string(name='Name', description='The name of the master instance. The name must be 1 to 63 characters in length. It must start with a letter, and can contain letters, digits, underscores (_), and hyphens (-).', example='ack-demo'),
  priceLimit?: string(name='PriceLimit', description='The limit on the prices of containers in the workflow. This parameter takes effect only if the WorkflowScheduleMode parameter is set to cost-optimized.', example='0.08'),
  publicAccessEnabled?: boolean(name='PublicAccessEnabled', description='Specifies whether to enable public domain name resolution in the Argo CD or Argo Workflow console. Valid values:

*   true
*   false', example='true'),
  publicApiServerEnabled?: boolean(name='PublicApiServerEnabled', description='Specifies whether to associate an elastic IP address (EIP) with the API server. Valid values:

*   true: associates an EIP with the API server. You can specify ApiServerEipId. If you do not specify ApiServerEipId, the system automatically creates an EIP.
*   false: disassociates an EIP from the API server.', example='true'),
  vSwitches?: [ string ](name='VSwitches', description='The vSwitches.'),
  workflowScheduleMode?: string(name='WorkflowScheduleMode', description='The scheduling mode of the workflow. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   cost-optimized: cost-prioritized scheduling mode.
*   stock-optimized: inventory-prioritized scheduling mode.', example='cost-optimized'),
}

model UpdateHubClusterFeatureShrinkRequest {
  accessControlListShrink?: string(name='AccessControlList', description='The Internet access control list (ACL). This parameter takes effect only if PublicAccessEnabled is set to true.'),
  apiServerEipId?: string(name='ApiServerEipId', description='The ID of the EIP.', example='eip-xxx'),
  argoCDEnabled?: boolean(name='ArgoCDEnabled', description='Specifies whether to enable Argo CD. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  argoCDHAEnabled?: boolean(name='ArgoCDHAEnabled', description='Specifies whether to enable high availability for Argo CD. Valid values:

*   true
*   false', example='true'),
  argoEventsEnabled?: boolean(name='ArgoEventsEnabled', description='Specifies whether to enable ArgoEvents. Valid values:

- true
- false', example='true'),
  argoServerEnabled?: boolean(name='ArgoServerEnabled', description='Specifies whether to enable the workflow instance UI. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  auditLogEnabled?: boolean(name='AuditLogEnabled', description='Specifies whether to enable the audit logging feature. Valid values:

*   true: enables the audit logging feature.
*   false: disables the audit logging feature.', example='true'),
  clusterId?: string(name='ClusterId', description='The cluster ID.

This parameter is required.', example='c46979b1075f04d99b5f2b710393e5****'),
  deletionProtection?: boolean(name='DeletionProtection', description='Specifies whether to enable the deletion protection feature for the cluster. After you enable the deletion protection feature for the cluster, you cannot delete the cluster in the console or by calling the DeleteHubCluster operation. Valid values:

*   true
*   false

Default value: false.', example='true'),
  enableMesh?: boolean(name='EnableMesh', description='Specifies whether to enable Service Mesh (ASM). Valid values:

*   true
*   false', example='true'),
  gatewayEnabled?: boolean(name='GatewayEnabled', description='Specifies whether to enable Gateway. Valid values:
- true
- false', example='true'),
  monitorEnabled?: boolean(name='MonitorEnabled', description='Specifies whether to enable the monitoring dashboard feature for the workflow instance. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   true
*   false', example='true'),
  name?: string(name='Name', description='The name of the master instance. The name must be 1 to 63 characters in length. It must start with a letter, and can contain letters, digits, underscores (_), and hyphens (-).', example='ack-demo'),
  priceLimit?: string(name='PriceLimit', description='The limit on the prices of containers in the workflow. This parameter takes effect only if the WorkflowScheduleMode parameter is set to cost-optimized.', example='0.08'),
  publicAccessEnabled?: boolean(name='PublicAccessEnabled', description='Specifies whether to enable public domain name resolution in the Argo CD or Argo Workflow console. Valid values:

*   true
*   false', example='true'),
  publicApiServerEnabled?: boolean(name='PublicApiServerEnabled', description='Specifies whether to associate an elastic IP address (EIP) with the API server. Valid values:

*   true: associates an EIP with the API server. You can specify ApiServerEipId. If you do not specify ApiServerEipId, the system automatically creates an EIP.
*   false: disassociates an EIP from the API server.', example='true'),
  vSwitchesShrink?: string(name='VSwitches', description='The vSwitches.'),
  workflowScheduleMode?: string(name='WorkflowScheduleMode', description='The scheduling mode of the workflow. This parameter takes effect only if Profile is set to XFlow. Valid values:

*   cost-optimized: cost-prioritized scheduling mode.
*   stock-optimized: inventory-prioritized scheduling mode.', example='cost-optimized'),
}

model UpdateHubClusterFeatureResponseBody = {
  requestId?: string(name='RequestId', description='The request ID.', example='52C1B7DF-96C1-5214-97B6-1B0859FEAFE5'),
}

model UpdateHubClusterFeatureResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateHubClusterFeatureResponseBody(name='body'),
}

/**
 * @summary Updates the configurations of a Container Service for Kubernetes (ACK) cluster that serves as a master instance.
 *
 * @param tmpReq UpdateHubClusterFeatureRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateHubClusterFeatureResponse
 */
async function updateHubClusterFeatureWithOptions(tmpReq: UpdateHubClusterFeatureRequest, runtime: Util.RuntimeOptions): UpdateHubClusterFeatureResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateHubClusterFeatureShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.accessControlList)) {
    request.accessControlListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.accessControlList, 'AccessControlList', 'json');
  }
  if (!Util.isUnset(tmpReq.vSwitches)) {
    request.vSwitchesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.vSwitches, 'VSwitches', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.accessControlListShrink)) {
    query['AccessControlList'] = request.accessControlListShrink;
  }
  if (!Util.isUnset(request.apiServerEipId)) {
    query['ApiServerEipId'] = request.apiServerEipId;
  }
  if (!Util.isUnset(request.argoCDEnabled)) {
    query['ArgoCDEnabled'] = request.argoCDEnabled;
  }
  if (!Util.isUnset(request.argoCDHAEnabled)) {
    query['ArgoCDHAEnabled'] = request.argoCDHAEnabled;
  }
  if (!Util.isUnset(request.argoEventsEnabled)) {
    query['ArgoEventsEnabled'] = request.argoEventsEnabled;
  }
  if (!Util.isUnset(request.argoServerEnabled)) {
    query['ArgoServerEnabled'] = request.argoServerEnabled;
  }
  if (!Util.isUnset(request.auditLogEnabled)) {
    query['AuditLogEnabled'] = request.auditLogEnabled;
  }
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.deletionProtection)) {
    query['DeletionProtection'] = request.deletionProtection;
  }
  if (!Util.isUnset(request.enableMesh)) {
    query['EnableMesh'] = request.enableMesh;
  }
  if (!Util.isUnset(request.gatewayEnabled)) {
    query['GatewayEnabled'] = request.gatewayEnabled;
  }
  if (!Util.isUnset(request.monitorEnabled)) {
    query['MonitorEnabled'] = request.monitorEnabled;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.priceLimit)) {
    query['PriceLimit'] = request.priceLimit;
  }
  if (!Util.isUnset(request.publicAccessEnabled)) {
    query['PublicAccessEnabled'] = request.publicAccessEnabled;
  }
  if (!Util.isUnset(request.publicApiServerEnabled)) {
    query['PublicApiServerEnabled'] = request.publicApiServerEnabled;
  }
  if (!Util.isUnset(request.vSwitchesShrink)) {
    query['VSwitches'] = request.vSwitchesShrink;
  }
  if (!Util.isUnset(request.workflowScheduleMode)) {
    query['WorkflowScheduleMode'] = request.workflowScheduleMode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateHubClusterFeature',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the configurations of a Container Service for Kubernetes (ACK) cluster that serves as a master instance.
 *
 * @param request UpdateHubClusterFeatureRequest
 * @return UpdateHubClusterFeatureResponse
 */
async function updateHubClusterFeature(request: UpdateHubClusterFeatureRequest): UpdateHubClusterFeatureResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateHubClusterFeatureWithOptions(request, runtime);
}

model UpdateUserPermissionRequest {
  clusterId?: string(name='ClusterId', description='The ID of the master instance.

This parameter is required.', example='c8e28143817db4b039b8548d7c899****'),
  namespace?: string(name='Namespace', description='The namespace to which the permissions are scoped. By default, this parameter is empty when you set RoleType to cluster.', example='default'),
  roleName?: string(name='RoleName', description='Specifies the predefined role that you want to assign. Valid values:

*   admin: the administrator role.
*   dev: the developer role.

This parameter is required.', example='admin'),
  roleType?: string(name='RoleType', description='The authorization type. Valid values:

*   cluster: specifies that the permissions are scoped to a master instance.
*   namespace: specifies that the permissions are scoped to a namespace of a cluster.

This parameter is required.', example='cluster'),
  userId?: string(name='UserId', description='The ID of the RAM user.

This parameter is required.', example='2176****'),
}

model UpdateUserPermissionResponseBody = {
  requestId?: string(name='RequestId', description='The ID of the request.', example='62F5AA2B-A2C9-5135-BCE2-C2167099****'),
}

model UpdateUserPermissionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateUserPermissionResponseBody(name='body'),
}

/**
 * @summary Updates the role-based access control (RBAC) permissions of a RAM user.
 *
 * @param request UpdateUserPermissionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateUserPermissionResponse
 */
async function updateUserPermissionWithOptions(request: UpdateUserPermissionRequest, runtime: Util.RuntimeOptions): UpdateUserPermissionResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.namespace)) {
    query['Namespace'] = request.namespace;
  }
  if (!Util.isUnset(request.roleName)) {
    query['RoleName'] = request.roleName;
  }
  if (!Util.isUnset(request.roleType)) {
    query['RoleType'] = request.roleType;
  }
  if (!Util.isUnset(request.userId)) {
    query['UserId'] = request.userId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdateUserPermission',
    version = '2022-01-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary Updates the role-based access control (RBAC) permissions of a RAM user.
 *
 * @param request UpdateUserPermissionRequest
 * @return UpdateUserPermissionResponse
 */
async function updateUserPermission(request: UpdateUserPermissionRequest): UpdateUserPermissionResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateUserPermissionWithOptions(request, runtime);
}

